#ifndef FILEMANAGER_H
#define FILEMANAGER_H

#include "IFileManager.h"
#include "PakFile.h"

//!Handle .zpak files.
/*!
This class handle any .zpak files. 
*/
class CFileManager: public IFileManager
{
private:
	//!vector of files
	vector<CPakFile*> m_vectorOfFile;

public:
	//!Constructor
	CFileManager();

	//!Destructor
	~CFileManager(void);

	//!Load a .zpak file.
	/*
	\param filename Name of the file to load.
	\return True if the loading succeeded. False if the loading failed.
	*/
	bool loadFile(const string& filename);

	//!Get a pointer to a data packed in a file.
	/*!
	Return a pointer to the file packed inside a zpak file. The function find which zpak file it is.
	\param pakedFilename Name of the file that we need.
	\param buffer Pointer to data of the file.
	\param size Size of the buffer.
	\return True if the file was found. False if the file doesn't exist in any .zpak file.
	*/
	bool getPackedFile(const string& pakedFilename, char** buffer, int* size);

	//!Close all the file
	/*!
	This function close the file and delete the buffers which were containing the files.
	\return True if it succeeded. False if it failed.
	*/
	bool closeFiles(void);
};

#endif

